1. Field of the Invention
The present invention relates to a communication system, a communication apparatus, a control method therefor, and a computer program in which a plurality of devices perform data transmission over a predetermined communication interface, and in particular to a communication system, a communication apparatus, a control method therefor, and a computer program in which one of the devices acts as a “host” and controls data transmission over the communication interface while the other devices acts as “devices” and perform data transmission over the communication interface under control of the host.
More specifically, the present invention relates to a communication system, a communication apparatus, a control method therefor, and a computer program in which dual-role communication devices having both host and device roles easily perform the host and device roles in an environment where a fixed host such as a personal computer (PC) is not present, and in particular to a communication system, a communication apparatus, a control method therefor, and a computer program in which communication devices that are initially designated as a host and a device exchange their host and device roles according to a predetermined communication protocol.
2. Description of the Related Art
Universal serial bus (USB) is a general-purpose bus interface standard supporting plug-and-play, which can replace legacy ports such as serial (RS-232C) and parallel ports. The USB specification was originally developed by four companies such as Intel Corporation, and is now developed and managed by a non-profit organization called USB Implementers Forum, Inc. (USB-IF). USB 2.0 whose specification provides High-Speed mode (up to 480 megabits per second (Mbps)), which is higher than IEEE 1394 transfer rates (up to 400 Mbps), has been widespread.
In USB, specifications called USB classes, which are grouped in accordance with capabilities of peripheral devices, are defined. Devices created according to each class specification provide the same function, and class-compliant devices are operated by a class driver without using driver software specific to each device.
USB is originally a transmission scheme based on wire cables, in which a plurality of devices are connected via a common serial communication bus to construct a USB communication system. Recently, an extension of USB into wireless communication, called “Wireless USB (WUSB)”, in which advantages of wired communication, such as safe and high-speed communication, and advantages of wireless communication, such as easy-to-use communication, are combined have been being developed. WUSB is based on Ultra Wide Band (UWB) technology, which is a wireless technology using an ultra wideband, and adopts a multiband orthogonal frequency division multiplexing (OFDM) system, which is promoted by the WiMedia Alliance, as a standard of the physical layer and media access control (MAC) layer. WUSB supports communication at rates up to 480 Mbps for a three-meter communication range and up to 110 Mbps for a ten-meter communication range, and allows up to 127 devices to be connected to one host by using a star topology.
In a USB communication system, one of a plurality of USB-connected devices achieves a function called “host” and the other devices achieve a function called “device” (although “device” may also be referred to as “function” or “peripheral”, “device” is used throughout this specification). In a wired USB system, a USB cable has an asymmetrical structure having an “A-plug” at an end thereof for connection to a host and a “B-plug” at the other end thereof for connection to a device. In this case, since a device into which the A-plug is plugged acts as a host and a device into which the B-plug is plugged acts as a device, the relationship between the host and the device is fixed.
A host serves to control overall data transmission over a USB interface, and a PC usually acts as a host. The host performs processing such as detecting a new USB-connected device and managing the flow of data over a bus. Devices, on the other hand, perform communication under control of the host. The devices communicate with only a host.
Basically, a host schedules USB-based communication and initiates the communication, and a device responds to the initiation of the communication. Specifically, a host delivers a request to a device, and the device responds to the request, thereby performing communication. The device transfers its information to the host or transmits and receives data to and from the host according to a response to requests from the host.
USB has been widespread as a technology for establishing a connection between, for example, a PC acting as a host and a peripheral device such as a printer acting as a device, and has become the de-facto industry standard. With the recent appearance of various USB-compatible peripheral devices, a demand for connection between such peripheral devices without the intervention of a PC has increased.
To meet the demand, USB On-The-Go (hereinafter referred to as “OTG”), which is a supplement to USB 2.0, has been developed. OTG allows a USB 2.0 host controller function to be definitely added to a non-host device such as a digital camera so that data can be directly transmitted between peripheral devices.
In a case where a PC and a peripheral device are connected using a USB interface, the host-device relationship is fixed; the PC acts as a host and the peripheral device acts as a device. The host-device relationship is also uniquely determined from the type of plugs of a USB cable (described above). In a case where peripheral devices are directly connected, however, it is desirable to flexibly determine the host and device roles between USB-connected devices such that, for example, a digital camera acts as a device when it is connected to a PC, and acts as a host when it performs direct printing to a printer.
In OTG, a dual role device (DRD) is defined as a device having both host and device functions. DRDs determine initial functions (host and device) according to the type of plugs of a USB cable connected to the DRDs. An OTG-compatible USB cable has an asymmetrical structure having a plug called Mini-A at an end thereof and a plug called Mini-B at the other end thereof. A Mini-A plugged device is initially a host, and a Mini-B plugged device is initially a device. A Mini-A plugged device is referred to as an “A-device”, and a Mini-B plugged device is referred to as a “B-device”.
OTG introduces communication protocols called Session Request Protocol (SRP) and Host Negotiation Protocol (HNP) in addition to the USB 2.0 communication protocol.
The A-device, defined in OTG, is allowed to stop the supply of current to a USB bus during a non-communication period. SRP is a communication protocol for allowing restart of the supply of current from the B-device to the A-device during a period in which the supply of current is stopped. By using SRP, the A-device is allowed to stop the supply of current to the USB bus until a request is issued from the B-device, resulting in a reduction in power consumption during the non-communication period.
Two DRDs connected to an OTG-compatible USB cable initially determine their host and device roles according to the type of plugs of the cable plugged into the DRDs (described above). HNP is a communication protocol for reversing the host and device roles without replugging the cable when one of the DRDs acts as a host and the other acts as a device. It is therefore unnecessary to replug the cable, resulting in improvement of user convenience.
By using OTG, data can be exchanged directly between peripheral devices without the intervention of a PC, such as between a digital camera or a scanner and a printer, between a mobile phone and a portable music player or a memory card reader, and between a personal digital assistant (PDA) and a hard disk drive or a magneto optical (MO) drive. For example, a PDA and a mobile phone may be USB-connected so that the PDA can be connected to the Internet, or a portable music player and a mobile phone may be USB-connected so that music files can be downloaded to the portable music player via the Internet. Further, a digital camera and a printer may be directly connected using a USB cable to perform “direct printing”.
One of communication standards that allow a digital camera and a printer to be USB-connected to perform direct printing is “PictBridge”, which was established by the Camera & Imaging Products Association (CIPA). PictBridge-compatible devices can perform direct printing without installing special software once they are connected using a USB cable. A user can operate buttons or the like of a digital camera to easily print an image being displayed on a liquid crystal monitor of the digital camera. The digital camera has capabilities of, besides specifying print setting (such as paper size), printing an image using printer default settings if no settings are specified for that image. Other various capabilities as well as printing a specified image, such as index printing in which a list of thumbnail images is printed, printing a plurality of copies of the same image, and printing an image stamped with date, are also utilized. If an event such as an error occurs during printing, an error warning may be displayed on the liquid crystal monitor or the like of the digital camera.
In USB communication, users may enter instructions such as start or end of communication and various settings not only via a user interface (a touch panel, a keyboard, or any other input device) on the host side but also via a user interface on the device side. This is to be understood from an example in which in the PictBridge standard described above, a printing instruction can be issued from a digital camera behaving as a device to a printer acting as a host, and is based on a communication protocol established between devices that are USB-connected according to the OTG standard.
In other words, a special communication protocol is used to transmit a certain command to the host by operating a user interface on the device side to instruct USB communication. Therefore, it is more effective in view of light communication load and easy design of devices that the host instructs USB communication unless special purposes exist. It is common to perform various USB communication operations via a user interface of a host device.
It is now assumed that a communication apparatus that is USB-connected to a DRD is a DRD having a host controller function, that is, DRDs are USB-connected.
The two DRDs are denoted by devices 1 and 2. The device 1, when acting as a host, supports devices that are generally different from those supported by the device 2 when acting as a host. However, if the devices 1 and 2 support each other (that is, if one of the devices 1 and 2 is provided with a device driver of the other device and vice versa), the A-device into which the Mini-A plug of the USB cable is plugged can performs the host function without changing its initial function.
If various USB communication operations are to be performed via a user interface on the host device, however, it is desirable to determine to which of the devices 1 and 2 to assign the host function by taking into account the operability of input devices, output devices, and other devices provided in the respective devices.
In a case where a USB communication system is established in which the A-device into which the Mini-A plug is plugged still acts as a host without changing its initial role, the connection direction of the USB cable (that is, which device to plug each of the Mini-A plug and Mini-B plug into) has no relationship with the operability of the user interfaces of the devices, and a desired one of the devices is not necessarily designated as a host. Since the A-device still acts as a host and performs USB communication operations, even if the B-device is higher in operability than the A-device, this characteristic may not be utilized.
Furthermore, it is not practical for users having no special knowledge of USB technology to correctly determine the connection direction of the USB cable by taking the operability of the devices 1 and 2 into account or to replug the USB cable when the host device is low in operability.
Even USB-connected devices of the same type may differ in operability or host-specific communication performance if the devices have different firmware versions. There may still arise a problem in that the operability of the host and the connection direction of the USB cable do not coincide with each other, and users may not enjoy the benefit of device's operability, which is higher than that of the host, and communication stability.
The problems caused by the A-device implementing the host function without changing its initial role are not limited to unsuitability for the physical operability of the devices.
It is difficult to plug the plug terminals at the ends of the USB cable into two devices at the same time. A user generally plugs in sequence one of the plugs into a desired device. When USB communication is enabled between the devices to which the USB cable is connected, the device plugged later may possibly be still held with the user's hand or may possibly be near the user. It is therefore convenient due to reduced time spent on user's movement or the like that USB communication operations be performed using the device plugged later (in other words, the host function be assigned to the device plugged later).
It is also convenient due to reduced time spent on user's movement or the like that USB communication operations be performed using a device whose user interface has been operated by a user or a device that has been moved around the user because such a device may be nearer the user.
It is also convenient due to reduced time spent on user's movement or the like that USB communication operations be performed using one of two USB-connected devices that has an application operating thereon for performing USB communication or that is being prepared for USB communication because the user may possibly desire to operate this device.
Accordingly, it is desirable that a device whose user interface for USB communication is operated, that is, a device to which the host function is assigned, be determined according to user convenience based on individual use conditions or the statuses of the devices. However, the determined device may not coincide with a device that is determined on the basis of the connection direction of the USB cable.
For example, a communication system in which connected DRDs exchange their host and device roles on the basis of communication capabilities of the DRDs to improve communication performance is disclosed in, for example, Japanese Unexamined Patent Application Publication No. 2005-250671. The disclosed communication system is designed to switch the host and device roles between USB-connected DRDs to reduce power consumption or improve communication rates, but is not configured to determine a host by taking into account the operability of the user interfaces of the USB-connected devices or user convenience for entering instructions relating to USB communication. Thus, the foregoing problem is not overcome.
Further, an image output system configured to switch the host and device roles according to HNP when the connection direction of two USB-connected DRDs is wrong is disclosed in, for example, Japanese Unexamined Patent Application Publication No. 2004-316072. The disclosed system is not configured to determine a host by taking into account the operability of the user interfaces of the USB-connected devices or the user convenience for entering instructions relating to USB communication. Thus, the foregoing problem is not overcome.